<?php
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
use yii\helpers\Url;

use yii\widgets\ActiveForm;
?>
<link rel="stylesheet" href="<?php echo Yii::getAlias("@web")?>/css/sky-forms.css">
<link rel="stylesheet" href="<?php echo Yii::getAlias("@web")?>/css/custom-sky-forms.css">
<div class="row">
    <div class="col-md-9">
        <?php
        $form = ActiveForm::begin([
            'id' => 'category-form',
            'options' => ['class' => 'sky-form'],
        ])
        ?>

            <header>General Unify Forms</header>

        <fieldset>
            <section>
                <label class="label">上级分类</label>
                <label class="select">
                    <select name="pid">
                        <option value=0>顶级分类</option>
                        <?php if($model){
                            foreach ($model as $k=>$v){
                        ?>
                        <option value="<?php echo $v->id;?>"><?php echo $v->name;?></option>
                        <?php Yii::$app->runAction("blog/child",['pid'=>$v->id]);?>
                        <?php }}?>
                    </select>
                    <i></i>
                </label>
            </section>
            <section>
                <label class="label">分类名称</label>
                <label class="input">
                    <input type="text" name="name">
                </label>
            </section>
            <section>
                <label class="label">开启状态</label>
                <label class="input">
                    <select name="status">
                        <option value="1">启用</option>
                        <option value="-1">禁用</option>

                    </select>
                    <i></i>
                </label>
            </section>
            <section>
                <label class="label">描述</label>
                <label class="textarea">
                    <textarea rows="3" name="desc"></textarea>
                </label>
                <div class="note"><strong>Note:</strong> height of the textarea depends on the rows attribute.</div>
            </section>
        </fieldset>
            <footer>
                <button class="btn-u" type="submit">Submit</button>
                <button onclick="window.history.back();" class="btn-u btn-u-default" type="button">Back</button>
            </footer>

        <?php ActiveForm::end() ?>
    </div>
</div>
